<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TableCtmonCrecruitmentCreate extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $table = $this->table('ctmon_recruitment', [
                    'id' => false,
                    'primary_key' => ['id'],
                    'engine' => 'InnoDB',
                    'signed' => false,
                    'collation' => 'utf8mb4_general_ci',
                    'comment' => '招聘岗位||']);
                $table->addColumn('id', 'biginteger', ['limit' => 20, 'signed' => false, 'identity' => true, 'null' => false, 'comment' => 'id'])
                    ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '名称'])
                    ->addColumn('en_name', 'string', ['limit' => 150, 'default' => '', 'comment' => '标识名'])
                    ->addColumn('type_id', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '类型id'])
                    ->addColumn('type_name', 'string', ['limit' => 50, 'default' => 0, 'comment' => '类型名称'])
                    ->addColumn('address', 'string', ['limit' => 50, 'default' => 0, 'comment' => '地址'])
                    ->addColumn('desc', 'string', ['limit' => 50, 'default' => 0, 'comment' => '描述（职位/人数）'])
                    ->addColumn('content', 'text', ['comment' => '内容'])
                    ->addColumn('rewrite_url', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '自定义路由'])
                    ->addColumn('sort', 'integer', ['limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '排序'])
                    ->addColumn('is_show', 'integer', ['limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '是否显示'])
                    ->addColumn('ver', 'biginteger', ['limit' => 20, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '版本检查'])
                    ->addColumn('create_time', 'integer', ['limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '创建时间'])
                    ->addColumn('update_time', 'integer', ['limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '修改时间'])
                    ->addColumn('delete_time', 'integer', ['limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '删除时间'])
                    ->create();
    }
}
